<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <!-- INTERFACE -->
    <cc:interface>
        <cc:attribute name="bill" />
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>
        <h:outputStylesheet library="css" name="pharmacyA4.css"/>
        <div class="posbill noBorder summeryBorder" >


            <div class="headingBill">
                <h:outputLabel value="Adjustment Note" style="text-decoration: underline;"/>                           
            </div>

            <h:panelGrid columns="4" style="min-width: 100%;">

                <h:outputLabel value="Adj No "/>
                <h:outputLabel value="#{cc.attrs.bill.deptId}"/> 


                <h:outputLabel value="Adjusted At  "/>
                <h:outputLabel value="#{cc.attrs.bill.createdAt}">
                    <f:convertDateTime pattern="dd MM yyyy hh mm a"/>
                </h:outputLabel >

                <h:outputLabel value="Adjusted By  "/>
                <h:outputLabel value="#{cc.attrs.bill.creater.webUserPerson.name}">
                </h:outputLabel>

                <h:outputLabel value="Department "/>
                <h:outputLabel value="#{cc.attrs.bill.department.name}">
                </h:outputLabel>
            </h:panelGrid>


            <div >
                <p:spacer height="15px"/>
                <p:dataTable rowIndexVar="rowIndex" styleClass="noBorder normalFont" 
                             value="#{cc.attrs.bill.billItems}" var="bip" style=" text-align: center;">                                     
                    <p:column style="text-align: left!important;"  >
                        <f:facet name="header">
                            <h:outputLabel value="Item" style="font-weight: bold!important; " />
                        </f:facet>
                        <h:outputLabel value="#{bip.item.name}"/>
                    </p:column>
                    <p:column style="width: 8px;text-align: right!important;" >
                        <f:facet name="header">
                            <h:outputLabel value="Expiry" style="font-weight: bold!important;" />
                        </f:facet>
                        <h:outputLabel value="#{bip.pharmaceuticalBillItem.doe}">
                            <f:convertDateTime pattern="dd/MM/yy"/>
                        </h:outputLabel>
                    </p:column>                                  

                    <p:column style="text-align: right!important;"> 
                        <f:facet name="header">                           
                            <h:outputLabel value="Before Purchase Price" style="font-weight: bold!important;" />
                        </f:facet>
                        <h:outputLabel  value="#{bip.pharmaceuticalBillItem.purchaseRate}" >
                            <f:convertNumber pattern="#00.00"/>
                        </h:outputLabel>
                    </p:column>                  


                    <p:column style="text-align: right!important;"> 
                        <f:facet name="header">                           
                            <h:outputLabel value="Purchase Price" style="font-weight: bold!important;" />
                        </f:facet>
                        <h:outputLabel value="#{bip.pharmaceuticalBillItem.stock.itemBatch.purcahseRate}" >
                            <f:convertNumber pattern="#00.00"/>
                        </h:outputLabel>
                    </p:column>                  

                </p:dataTable>
            </div>

            <h:panelGrid columns="2" style="min-width: 100%;">
                <h:outputLabel value="Comment" ></h:outputLabel>
                <h:outputLabel value="#{cc.attrs.bill.comments}" >
                </h:outputLabel>
            </h:panelGrid>
        </div>
    </cc:implementation>
</html>
